#ifndef SETTINGLIB_H
#define SETTINGLIB_H

#include <QObject>
#include <QSettings>
#include <QFile>
#include <QHash>
#include "AbstractLayer/Encipher/encipher.h"
class SettingLib : public QObject
{
    Q_OBJECT
public:
    enum Type{
        USER,
        PASSWORD,
        REMEMBER,
        AUTOLOGON,
        NEWMESSAGERING,
        VOICECALLRING,
        VIDEOCALLRING,
        ENTER,
        RING
    };
    Q_ENUM(Type);
public:
    static SettingLib* getInstance();
    void initSettings();
    void setValue(Type type,QVariant val);
    QVariant getValue(Type key);
    bool isFirst();
signals:
    void s_loadDone();

    void s_newmessagering(bool);
    void s_voicecallring(bool);
    void s_videocallring(bool);
    void s_enter(bool);
    void s_ring(int);
private:
    SettingLib();
    static SettingLib* settinglib;
    QSettings* settings;
    QHash<Type,QVariant> settingshash;
};

#endif // SETTINGLIB_H
